/**
 * Created by yangxu on 2017/10/23.
 */
import Vue from 'vue'

import  Config  from "@/conf/params.js";

import axios from 'axios';

export default {

  doGetMyTask (token, searchParams) {

    return axios({
      method:'get',
      url:`${Config.server}/v1/getMyTask`,
      params: searchParams,
      headers:{
        "Authorization":"Bearer "+token
      }
    })
  },
  getTaskInfo (token, taskId) {
    return axios({
      method:'get',
      url:`${Config.server}/v1/getTaskInfo`,
      params: {
        id: taskId
      },
      headers:{
        "Authorization":"Bearer "+token
      }
    })
  },
  supervisorCheckPlan (token, data) {
    return axios({
      url:`${Config.server}/v1/taskmasterExamine`,
      method:'post',
      data: data,
      headers: {
        "Authorization":"Bearer "+token
      }
    });
  },
  supervisorCheckProgressPlan (token, data) {
    return axios({
      url:`${Config.server}/v1/ownerExamine`,
      method:'post',
      data: data,
      headers: {
        "Authorization":"Bearer "+token
      }
    });
  },
  // 工程部
  engineerCheckProgressPlan (token, data) {
    return axios({
      url:`${Config.server}/v1/examine/engineer`,
      method:'post',
      data: data,
      headers: {
        "Authorization":"Bearer "+token
      }
    });
  },
  // 总工
  chiefEngineerCheckProgressPlan (token, data) {
    return axios({
      url:`${Config.server}/v1/examine/chiefEngineer`,
      method:'post',
      data: data,
      headers: {
        "Authorization":"Bearer "+token
      }
    });
  },
  ownerCheckFinish (token, data) {
    return axios({
      url:`${Config.server}/v1/checkFinish`,
      method:'post',
      data: data,
      headers: {
        "Authorization":"Bearer "+token
      }
    })
  },
  constructionAnalyze (token, data) {
    return axios({
      url:`${Config.server}/v1/constructor/analyze/cause`,
      method:'post',
      data: data,
      headers: {
        "Authorization":"Bearer "+token
      }
    })
  },
  superviseAnalyze (token, data) {
    return axios({
      url:`${Config.server}/v1/taskmaster/analyze/examine`,
      method:'post',
      data: data,
      headers: {
        "Authorization":"Bearer "+token
      }
    })
  },
  ownerAnalyze (token, data) {
    return axios({
      url:`${Config.server}/v1/owner/analyze/examine`,
      method:'post',
      data: data,
      headers: {
        "Authorization":"Bearer "+token
      }
    })
  },
  taskmasterExaminePlan (token, data) {
    return axios({
      url:`${Config.server}/v1/review/newPlan`,
      method:'post',
      data: data,
      headers: {
        "Authorization":"Bearer "+token
      }
    })
  },
  ownerCheckResult (token, data) {
    return axios({
      url:`${Config.server}/v1/owner/supervision`,
      method:'post',
      data: data,
      headers: {
        "Authorization":"Bearer "+token
      }
    })
  }

}
